<?php
    $topten = User::model()->signedAccount()->topTen('amount DESC')->findAll();
    $total =count($topten);
?>

<div class="topten">
<?php if($total>0){ ?>
    <ul>
        <?php foreach ($topten as $idx=>$user) {
                $idx+=1
                $topClass = ($idx<=3) ? 'hgf' : ''; ?>
            <li><span class="<?php echo $topClass; ?>">$idx</span>
                <a href="<?php echo $this->createUrl('user/profile', array('id'=>$user->id)); ?>"><?php echo $user->username; ?></a>
                <p><?php echo $user->amount; ?></p>
            </li>
        <?php } ?>
    </ul>
    <?php if($total==10){ ?>
        <a class="xh-ct" href="<?php echo $this->createUrl('top/index', array('page'=>2)); ?>"><?php echo Yii::t('main', 'readmore'); ?> &gt;&gt;</a>
    <?php }else{
        echo '<p>'.Yii::t('msg', '0045').'</p>';
    } ?>
<?php }else{
    echo '<p>'.Yii::t('msg', '0045').'</p>';
} ?>
</div>
<div class="clearfix"></div>